<html>
<head>
</head>
<script type="text/javascript" src="<?php echo "$base/js/jquery.js";?>"></script>
<script language="javascript" type="text/javascript" src="<?php echo base_url();?>js/tiny_mce/jquery.tinymce.js"></script>
<script language="javascript">
	$().ready(function() {
		$('textarea.tinymce').tinymce({
			// Location of TinyMCE script
			script_url : "<?php echo base_url();?>js/tiny_mce/tiny_mce.js",
			mode : "exact",
			theme : "advanced",
			//remove_script_host : false,
       		convert_urls : false,
			plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,xhtmlxtras",
			// Theme options
			theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect,absolute",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,code,|,preview,|,forecolor,backcolor,ins,attribs",
			theme_advanced_buttons3 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,
			file_browser_callback : "ajaxfilemanager",

			template_replace_values : {
				username : "Some User",
				staffid : "991234"
			}
		});
	});
	
	function ajaxfilemanager(field_name, url, type, win) {
			var ajaxfilemanagerurl = "<?php echo base_url();?>js/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php";
	
			switch (type) {
				case "image":
					break;
				case "media":
					break;
				case "flash": 
					break;
				case "file":
					break;
				default:
					return false;
			}
            tinyMCE.activeEditor.windowManager.open({
                url: "<?php echo base_url();?>js/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php",
                width: 782,
                height: 440,
                inline : "yes",
                close_previous : "no"
            },{
                window : win,
                input : field_name
            });
	}

</script>

<script language="javascript">
function buka()
{
	w_left = (screen.width-500)/2;
	w_top  = (screen.height-420)/2;

	window.moveTo(w_left,w_top);
}

</script>
<script type="text/javascript">
function add_file_field(){
var container=document.getElementById('file_container');
var file_field=document.createElement('input');
file_field.name='images[]';
file_field.type='file';
container.appendChild(file_field);
var br_field=document.createElement('br');
container.appendChild(br_field);
}

</script>

<style>
body
{
	padding:2%;
}
</style>

<body onLoad="buka()">
	<form action="<?php echo $form_action;?>" method="post"  enctype="multipart/form-data">
		<table>
		
			<tr>
				<td>Comment ID</td><td>:</td><td><input type="text" name="id" value="<?php echo $idcmnt;?>"  disabled="disabled"/><input type="hidden" name="id_cmnt" value="<?php echo $idcmnt;?>"  /></td>
			</tr>
			<tr>
				<td>Ticket ID</td><td>:</td><td><input type="text" name="ticket_id" value="<?php echo $ticket_id;?>" disabled="disabled" /><input type="hidden" name="ticket_id" value="<?php echo $ticket_id;?>"  /></td>
			</tr>
			<tr>
				<td>User ID</td><td>:</td><td><input type="hidden" name="user_id" value="<?php echo $user_id;?>" /><input type="text" value="<?php echo $name;?>" disabled="disabled"></td>
			</tr>
			<tr>
				<td>Notes</td><td>:</td><td><td></td>
			</tr>
			<tr>
				<td></td><td></td><td><textarea name="notes" cols="20" rows="20" class="tinymce"><?php echo $notes;?></textarea></td>
			</tr>
			<tr>
				<td>Tanggal</td><td>:</td><td><input type="text" name="tanggal" readonly="" value="<?php echo $tanggal;?>" /></td>
			</tr>
			<tr>
    			<td></td><td></td><td><div id="file_container">
    			<input name="images[]" type="file"  /><br />
    
  				</div><a href="javascript:void(0);" onClick="add_file_field();">Add another</a></td><td></td>
    		</tr>
			<tr>
				<td></td><td></td><td>&nbsp;&nbsp;</td>
			</tr>
			<tr>
				<td></td><td></td><td><input type="submit"  value="kirim" name="save" />&nbsp;&nbsp;<input type="reset" value="hapus" /> &nbsp;&nbsp;<input type="button" value="Close" onClick="window.close()" />
			</tr>
			
		</table>
	</form>
</body>
</html>
